package com.design.dynamic;

import java.lang.reflect.Proxy;

/**
 * 测试类
 */
public class Test {
    public static void main(String[] args) {
        UserService userService = new UserServiceImpl();
        UserService proxy = (UserService) Proxy.newProxyInstance(
                userService.getClass().getClassLoader(), // 类加载器
                userService.getClass().getInterfaces(), // 接口数组
                new LoggerInvoicationHandle(userService));//处理器
        proxy.getUserInfo();
    }
}
